// Fill out your copyright notice in the Description page of Project Settings.


#include "AttackingNotifyState.h"
#include "CombatGameCharacter.h"
#include "Components/SkeletalMeshComponent.h"

void UAttackingNotifyState::NotifyBegin(USkeletalMeshComponent* MeshComp, UAnimSequenceBase* Animation, float TotalDuration)
{
	if (MeshComp) {
		ACombatGameCharacter* Owner = Cast<ACombatGameCharacter>(MeshComp->GetOwner());
		if (Owner) {
			Owner->OnAttackEnableChanged(true);
		}
	}
}

void UAttackingNotifyState::NotifyEnd(USkeletalMeshComponent* MeshComp, UAnimSequenceBase* Animation)
{
	if (MeshComp) {
		ACombatGameCharacter* Owner = Cast<ACombatGameCharacter>(MeshComp->GetOwner());
		if (Owner) {
			Owner->OnAttackEnableChanged(false);
		}
	}
}
